import abc
import random as ran

class CrossoverStrategy(object):
    __metaclass__ = abc.ABCMeta
    """description of class"""
    
    @abc.abstractmethod
    def cross(self, parents):
        raise NotImplementedError()

    def _linearly_combine(self, parent1, parent2):
        lam = ran.random()
        genotype1 = lam * parent1 + (1 - lam) * parent2
        genotype2 = lam * parent2 + (1 - lam) * parent1
        return genotype1, genotype2